package sd.qd.xiaoming.coffeedesk.dao;

import javax.persistence.TypedQuery;

import org.springframework.stereotype.Repository;

import sd.qd.xiaoming.coffeedesk.entity.CdShareAccount;

@Repository
public class CdShareAccountDAO extends BaseDAO<CdShareAccount> {

	protected CdShareAccountDAO() {
		super(CdShareAccount.class);
	}

    public CdShareAccount findByCode(final String code) {
        TypedQuery<CdShareAccount> query = this.entityManager
.createQuery(
                "select acc from CdShareAccount acc where acc.code=:code",
                CdShareAccount.class);
        query.setParameter("code", code);
        return query.getSingleResult();
    }

}
